package com.zzb.projectfactory.controller.common;

import com.zzb.projectfactory.framework.common.BaseController;
import com.zzb.projectfactory.framework.common.BaseResponse;
import com.zzb.projectfactory.framework.role.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 公共controller 只有登录后才可使用
 * Created by zhangzhenbin on 17-2-22.
 */
@Controller
@RequestMapping("/user")
public class UserCommonController extends BaseController {
    @Autowired
    private UserService userService;

    @RequestMapping("/logout")
    @ResponseBody
    public BaseResponse logout(HttpServletRequest request){
        removeUserSession(request);
        return new BaseResponse(BaseResponse.SUCCESS,"登出成功");
    }
}
